public class ArmorRetriever {
  Random r = new Random();
  Scanner sc = null;

  public Armor getRandBody() {
    try {
      sc = new Scanner(createReader("Bodies.txt"));
      sc.useDelimiter(",");
    }
    finally {
    }
    return new Body(sc.next(), sc.nextInt(), sc.nextInt(), sc.nextInt(), sc.nextInt());
  }
  public Armor getRandHelm() {
    try {
      sc = new Scanner(createReader("Helms.txt"));
      sc.useDelimiter(",");
    }
    finally {
    }
    return new Helm(sc.next(), sc.nextInt(), sc.nextInt(), sc.nextInt(), sc.nextInt());
  }
  public Armor getRandGloves() {
    try {
      sc = new Scanner(createReader("Gloves.txt"));
      sc.useDelimiter(",");
    }
    finally {
    }
    return new Gloves(sc.next(), sc.nextInt(), sc.nextInt(), sc.nextInt(), sc.nextInt());
  }
  public Armor getRandPants() {
    try {
      sc = new Scanner(createReader("Pants.txt"));
      sc.useDelimiter(",");
    }
    finally {
    }
    return new Pants(sc.next(), sc.nextInt(), sc.nextInt(), sc.nextInt(), sc.nextInt());
  }
  public Armor getRandAccessory() {
    try {
      sc = new Scanner(createReader("Accessories.txt"));
      sc.useDelimiter(",");
    }
    finally {
    }
    return new Accessory(sc.next(), sc.nextInt(), sc.nextInt(), sc.nextInt(), sc.nextInt());
  }
  public Armor getRandShoes() {
    try {
      sc = new Scanner(createReader("Shoes.txt"));
      sc.useDelimiter(",");
    }
    finally {
    }
    return new Shoes(sc.next(), sc.nextInt(), sc.nextInt(), sc.nextInt(), sc.nextInt());
  }
  public Armor getRandWeapon() {
    try {
      sc = new Scanner(createReader("Weapons.txt"));
      sc.useDelimiter(",");
    }
    finally {
    }
    return new Weapon(sc.next(), sc.nextInt(), sc.nextInt(), sc.nextInt(), sc.nextInt(), sc.nextInt(), sc.nextInt());
  }
}

